fix: call init_weights() instead of initialize_weights() to restore w…#2213
Open
Meiyim wants to merge 2 commits into
Open
fix: call init_weights() instead of initialize_weights() to restore w…#2213Meiyim wants to merge 2 commits into
Meiyim wants to merge 2 commits into
Conversation
Contributor
|
Hi @Meiyim thanks a lot for the fix! I see that there's a conflict with main, would you mind taking a look? I can then help trigger the CI. Please let me know if I can help with anything. Thank you |
82fa837 to
43d7766
Compare
Author
|
hi @akoumpa, i resolved the conflict. can you trigger CI ,thanks. |
Contributor
|
/ok to test 43d7766 |
Contributor
|
Hi @Meiyim thanks for making this, I see there's a few tests failing, can you take a look? it's ok to update the tests if needed. Please let me know if there's anything I can help. |
…eight tying after FSDP2
Align test assertions with the renamed method in checkpointing.py.
43d7766 to
2ea4e19
Compare
Author
|
hi @akoumpa , i update some of the testcase, can you trigger another round of unittesting ? |
Contributor
|
/ok to test 2ea4e19 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
initialize_weights() only runs per-module _init_weights; init_weights() additionally calls tie_weights() afterward, restoring the lm_head/embed_tokens weight tie that FSDP2's fully_shard() breaks by replacing shared parameters with separate DTensors.
What does this PR do ?
Fix broken weight tying for models with shared embeddings (e.g. tie_word_embeddings=True) when training from scratch with FSDP2.
Changelog
Before your PR is "Ready for review"
Additional Information